import request from '@/config/axios'

// 场地设备 VO
export interface VenueEquipmentVO {
  id: number // 序号
  name: string // 名称
  unit: string // 单位
  quantity: number // 数量
  remark: string // 备注（自有产权/租赁等）
}

// 场地设备 API
export const VenueEquipmentApi = {
  // 查询场地设备分页
  getVenueEquipmentPage: async (params: any) => {
    return await request.get({ url: `/eval/venue-equipment/page`, params })
  },

  // 查询场地设备详情
  getVenueEquipment: async (id: number) => {
    return await request.get({ url: `/eval/venue-equipment/get?id=` + id })
  },

  // 新增场地设备
  createVenueEquipment: async (data: VenueEquipmentVO) => {
    return await request.post({ url: `/eval/venue-equipment/create`, data })
  },

  // 修改场地设备
  updateVenueEquipment: async (data: VenueEquipmentVO) => {
    return await request.put({ url: `/eval/venue-equipment/update`, data })
  },

  // 删除场地设备
  deleteVenueEquipment: async (id: number) => {
    return await request.delete({ url: `/eval/venue-equipment/delete?id=` + id })
  },

  // 导出场地设备 Excel
  exportVenueEquipment: async (params) => {
    return await request.download({ url: `/eval/venue-equipment/export-excel`, params })
  }
}